package com.yy.utils;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author young
 * @date 2022/8/27 15:28
 * @description: 日期解析工具
 */
public class DateUtil {
    /** 初始创建日期解析工具 **/
    private static final SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
    public static Date stringToDate(String msg) throws ParseException {
        return sdf.parse(msg);
    }
    
    public static String dateToString(Date date){
       return sdf.format(date);
    }
}
